/*
* -------------------------------------------------------
* Copyright (c) 2015, 天士力
* All rights reserved.
* 
* FileName：IdCardValidator.java
* Description：简要描述本文件的内容
* History：
* Date           Author               Desc
* 2017/3/1      ChengZhenxing        Desc
* -------------------------------------------------------
*/
package com.elegant.code.validator;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * Created by ChengZhenxing on 2017/3/1.
 */
public class IdCardValidator implements ConstraintValidator<IdCard, String> {

    @Override
    public void initialize(IdCard constraintAnnotation) {
    }

    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return value == null || IdCardInfoValidator.isValidatedAllIdcard(value);
    }
}
